<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
	<script src="/js/jquery/jquery.min.js"></script>
	<script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
	<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
	<link rel="stylesheet" href="/css/reset.css" />
	<link rel="stylesheet" href="/css/strategy.css" />
	<script src="/js/plugins/jrender/jrender.min.js"></script>
	<link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
	<script src="/js/plugins/dialog2/dialog.min.js"></script>
	<script src="/js/common.js"></script>
	<link rel="stylesheet" href="/js/jquery-message/css/iziToast.css">
	<link rel="stylesheet" href="/js/jquery-message/css/demo.css">
	<script>
		$(function () {
		    //统计各个类型的未读消息
            //获取当前用户
            var user = JSON.parse(sessionStorage.getItem("user"));
            //获取所有未读的游记点赞消息
            $.get("/message/thumbs",{readId:1,userId:user.id},function (data) {
                if(data.total!=0){
                $("#thumbs").html(data.total);
				}
            });
            $.get("/message/comments",{readId:1,userId:user.id},function (data) {
                if(data.total!=0) {
                    $("#comments").html(data.total);
                }
            });
            $.get("/message/notices",{readId:1,userId:user.id},function (data) {
                if(data.total!=0) {
                    $("#notices").html(data.total);
                }
            });
			//获取未读消息
			$.get("/userChats/"+user.id+"/totalNum",function (data) {
			    if(data){
                    $("#messages").html(data);
                }
			})
        });
	</script>

<title>我的消息</title>
</head>
<body><!--<script src="/demos/googlegg.js"></script>-->
<main>
	<section class="cd-section" id="Welcome">
		<div class="highlight bg">
		<a href="/mine/profiles.html" style="color: black">
			<span><i class="fa fa-angle-left fa-2x" ></i></span>
		</a>
			<div class="core" style="font-size: larger">
					<span class="examples">消息提示</span>
					<ul class="buttons">
						<li >
							<div>
								<a href="#" class="trigger-error fa fa-thumbs-o-up">赞<span class="badge badge-danger badge-pill thumbs" id="thumbs"></span>
								</a>
							</div>
						</li>
						<li>
							<div>
								<a href="#" class="trigger-success fa fa-commenting-o" data-iziToast>评论<span class="badge badge-danger badge-pill" id="comments"></span>
								</a>
							</div>
						</li>
						<li>
							<div>
								<a href="#" class="trigger-custom1 fa fa-envelope-o">私信<span class="badge badge-danger badge-pill" id="messages"></span>
								</a>
							</div>
						</li>
						<li>
							<div>
								<a href="#" class="trigger-info fa fa-bell" data-iziToast>系统通知<span class="badge badge-danger badge-pill" id="notices"></span>
								</a>
							</div>
						</li>
						<li class="lava"></li>
					</ul>
				</div>
				<div class="reply">
					<input type="text" class="reply"><span class="reply"><button class="replySend">回复</button></span>
				</div>


		</div>
	</section>
</main>

<script src="/js/jquery-message/js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="/js/jquery-message/js/iziToast.js" type="text/javascript"></script>
<script src="/js/jquery-message/js/demo.js" type="text/javascript"></script>

</body>
</html>